﻿<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
        <meta http-equiv="Cache-Control" content="no-siteapp" />
        <!--[if lt IE 9]>
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/html5shiv.js"></script>
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/respond.min.js"></script>
        <![endif]-->
        <link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/static/h-ui/css/H-ui.min.css" />
        <link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/static/h-ui.admin/css/H-ui.admin.css" />
        <link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/lib/Hui-iconfont/1.0.8/iconfont.css" />
        <link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/static/h-ui.admin/skin/default/skin.css" id="skin" />
        <link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/static/h-ui.admin/css/style.css" />
        <!--[if IE 6]>
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
        <script>DD_belatedPNG.fix('*');</script>
        <![endif]-->
        <title>支付配置</title>
    </head>
    <body>
        <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 账户管理 <span class="c-gray en">&gt;</span> 支付配置 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
        <div class="page-container">
            <div class="form form-horizontal col-sm-6 pd-20 radius" style="border: 1px solid #ccc;border-radius: 10px;box-shadow:2px 2px 5px #d3d6da;">
                <div class="tabBar cl">
                    <span class="radius" style="height: 40px;line-height: 40px">支付配置</span>
                    <button class="f-r btn radius btn-primary size-M" onClick="">受理模式</button>
                </div>
                <div class="Huialert Huialert-danger mt-15 mb-15 radius">
                    温馨提示：<br/><br/>
                    1、受理模式下，您需通过实名认证后才能使用本平台。<br/><br/>
                    2、受理模式下所产生的支付金额以及其他相关都会由银行进行管理和结算，如有疑问请联系平台客服。<br/><br/>
                </div>
                <div class="Huialert Huialert-info radius text-c lh-30">
                    <div class="col-sm-4"><img src="__STATIC__/admin/images/weixin.png" class="img-responsive" alt="微信支付"></div>
                    支付参数配置
                    <div class="col-sm-4 f-r">
                        <button class="f-r btn radius btn-success size-M" onClick="config()">配置信息</button>
                    </div>
                </div>
            </div>
            
        </div>
        
        <div id="modal-config" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-dialog">
                        <div class="modal-content radius">
                                <div class="modal-header">
                                    <h3 class="modal-title text-c"><b>支付配置</b></h3>
                                        <a class="close" data-dismiss="modal" aria-hidden="true" href="javascript:void();">×</a>
                                </div>
                                <div class="modal-body">
                                    <form class="form form-horizontal" id="form-payConfig-change">
                                        <div class="row cl">
                                            <label class="form-label col-sm-12" style="text-align: left;font-weight: bold;">
                                                <span class="c-red">*</span> 普通商户号：</label>
                                            <div class="formControls col-sm-12">
                                                <input type="text" class="input-text" value="" placeholder="" id="name" name="name">
                                            </div>
                                        </div>
                                        <div class="row cl">
                                            <label class="form-label col-sm-12" style="text-align: left;font-weight: bold;">
                                                <span class="c-red">*</span> 商户秘钥：</label>
                                            <div class="formControls col-sm-12">
                                                <input type="text" class="input-text" value="" placeholder="" id="name1" name="name1">
                                            </div>
                                        </div>
                                        <div class="row cl">
                                            <label class="form-label col-sm-12" style="text-align: left;font-weight: bold;">
                                                <span class="c-red">*</span> Appid：</label>
                                            <div class="formControls col-sm-12">
                                                <input type="text" class="input-text" value="" placeholder="" id="name2" name="name2">
                                            </div>
                                        </div>
                                        <div class="row cl">
                                            <label class="form-label col-sm-12" style="text-align: left;font-weight: bold;">
                                                <span class="c-red">*</span> AppSecret：</label>
                                            <div class="formControls col-sm-12">
                                                <input type="text" class="input-text" value="" placeholder="" id="name3" name="name3">
                                            </div>
                                        </div>
                                        <div class="row cl">
                                            <label class="form-label col-sm-12" style="text-align: left;font-weight: bold;">
                                                <span class="c-red">*</span> 关联商户id（多个商户id以‘,’分隔开）：</label>
                                            <div class="formControls col-sm-12">
                                                <input type="text" class="input-text" value="" placeholder="" id="name4" name="name4">
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <div class="modal-footer">
                                        <button class="btn radius" data-dismiss="modal" aria-hidden="true">取消</button>
                                        <button class="btn btn-primary radius" onClick="payConfig()">确定</button>
                                </div>
                        </div>
                </div>
        </div>
        <!--_footer 作为公共模版分离出去-->
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/jquery/1.9.1/jquery.min.js"></script> 
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/layer/2.4/layer.js"></script>
        <script type="text/javascript" src="__STATIC__/admin/hui/static/h-ui/js/H-ui.min.js"></script> 
        <script type="text/javascript" src="__STATIC__/admin/hui/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

        <!--请在下方写此页面业务相关的脚本-->
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/jquery.validation/1.14.0/validate-methods.js"></script>
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/jquery.validation/1.14.0/messages_zh.js"></script>
        <script type="text/javascript" src="__STATIC__/admin/hui/lib/jquery/1.9.1/jquery.md5.js"></script> 
        <script>
            function config(){
                $("#modal-config").modal("show");
            }
            
            function payConfig() {
                $("#form-payConfig-change").submit();
            }
            
            $(function () {
                $("#form-payConfig-change").validate({
                    rules: {
                        name: {
                            required: true
                        },
                    },
                    onkeyup: false,
                    focusCleanup: true,
                    success: "valid",
                    submitHandler: function (form) {
                        $(form).ajaxSubmit({
                            type: 'post',
                            url: "{:url('merchant/payConfig')}",
                            success: function (data) {
//                                    alert(data);
                                layer.msg(data, {icon: 1, time: 1000}, function () {
                                    location.reload();
                                });
                            },
                            error: function (XmlHttpRequest, textStatus, errorThrown) {
                                layer.msg('error!', {icon: 1, time: 1000});
                            }
                        });
                    }
                });
            });
        </script>
    </body>
</html>